<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/WEB-INF/layout/t.xhtml">

	<ui:define name="title">
		<h:outputText value="Cambio Password" />
	</ui:define>

	<ui:define name="content">
		<h:form id="pwd">
			<center>
				<p:panel header="Cambio Password">

					<h:panelGrid columns="2" style="width: 95%">

						<h:outputLabel value="Username:" for="username" />
						<h:outputText id="username"
							value="#{loginController.userAuth.username}" style="width: 100%;" />

						<h:outputLabel value="Password corrente(*):" for="opwd" />
						<h:inputSecret required="true" id="opwd"
							value="#{loginController.userAuth.oldPassword}"
							style="width: 100%;" />

						<h:outputLabel value="Nuova password(*):" for="npwd" />
						<h:inputSecret required="true" id="npwd"
							value="#{loginController.userAuth.newPassword}"
							style="width: 100%;" />

						<h:outputLabel value="Conferma nuova password(*):" for="cpwd" />
						<h:inputSecret required="true" id="cpwd"
							value="#{loginController.userAuth.confirmPassword}"
							style="width: 100%;" />

					</h:panelGrid>
					<br />

				</p:panel>
				<br /> <br />

				<h:panelGrid columns="4">
					<h:commandButton action="#{loginController.changePassword}"
						value="Procedi" immediate="false"
						onclick="if (!confirm('Attenzione: verra\' richiesto di eseguire il login con le nuove credenziali. Continuare?')) return false" />

					<h:commandButton id="reset" action="#{loginController.reset}"
						value="Annulla" immediate="true" />
				</h:panelGrid>
			</center>

		</h:form>
	</ui:define>
</ui:composition>